package com.jnmd.cctmall.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jnmd.cctmall.pojo.TbItem;
import com.jnmd.cctmall.service.TbItemService;

@Controller
public class ItemController {
	
	@Autowired
	private TbItemService tbItemService;
	
	@RequestMapping("item/{itemId}")
	@ResponseBody
	public TbItem showItemById(@PathVariable Long itemId){
		TbItem tbItem = tbItemService.findItemById(itemId);
		return tbItem;
	}
}
